<?php /* Smarty version 2.6.20, created on 2016-07-20 09:51:29
         compiled from ./income/create.php */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('block', 'shops', './income/create.php', 9, false),array('function', 'html_select_date', './income/create.php', 62, false),array('function', 'html_options', './income/create.php', 89, false),array('modifier', 'default', './income/create.php', 62, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/top.php", 'smarty_include_vars' => array('subject' => 'income')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "income/top.php", 'smarty_include_vars' => array('subject' => 'income')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<div id="content">
  <form method="post">
    <table width="100%" border="0" cellpadding="5" cellspacing="0" id="editor">
      <tr>
        <td width="100" class="title">仓库: *</td>
        <td width="240" class="content"><select name="shopid"><?php $this->_tag_stack[] = array('shops', array()); $_block_repeat=true;smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat);while ($_block_repeat) { ob_start(); ?><option value="<?php echo $this->_tpl_vars['shops']['id']; ?>
" <?php if ($this->_tpl_vars['shops']['id'] == $_POST['shopid']): ?>selected<?php elseif (( ! $_POST['shopid'] ) && $this->_tpl_vars['shops']['id'] == $_GET['shopid']): ?>selected<?php endif; ?> <?php if (1 == $this->_tpl_vars['shops']['disabled']): ?>disabled<?php endif; ?>><?php echo $this->_tpl_vars['shops']['title']; ?>
</option><?php $_block_content = ob_get_contents(); ob_end_clean(); $_block_repeat=false;echo smarty_block_shops($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat); }  array_pop($this->_tag_stack); ?></select></td>
        <td width="804" class="content">
        <?php if ($this->_tpl_vars['errors']['empty_shopid']): ?><span class="warning">请选择仓库</span>
        <?php else: ?>&nbsp;<?php endif; ?>
        </td>
      </tr>
      <tr>
        <td class="title">产品名称: *</td>
        <td class="content"><input name="product" type="text" id="product" value="<?php echo $_POST['product']; ?>
" size="30" onclick="select()"
        onkeyup="context_menu_products(this, 'productid=[product_sku_id],product=[title],spec=[spec],unit=[unit],pricebuy=[pricebuy]')"
        onfocus="context_menu_products(this, 'productid=[product_sku_id],product=[title],spec=[spec],unit=[unit],pricebuy=[pricebuy]')" />
        </td>
        <td class="content">
        <?php if ($this->_tpl_vars['errors']['empty_product']): ?><span class="warning">产品名称不能为空</span>
        <?php elseif ($this->_tpl_vars['errors']['unexist_product']): ?><span class="warning">产品数据中找不到该产品</span>
        <?php else: ?>在此输入/选择产品编号后产品信息会自动填写
        <?php endif; ?>
        </td>
      </tr>
     <tr style="display:none;">
        <td class="title">产品编号:</td>
        <td class="content"><input name="productid" type="text" id="productid" value="<?php echo $_POST['productid']; ?>
" size="30" readonly="readonly" /></td>
        <td class="content">&nbsp;</td>
      </tr>
      <tr>
        <td class="title">产品批号:</td>
        <td class="content"><input name="lotnumber" type="text" id="lotnumber" value="<?php echo $_POST['lotnumber']; ?>
" size="30" /></td>
        <td class="content">
<!--         <?php if ($this->_tpl_vars['errors']['empty_lotnumber']): ?><span class="warning">产品批号不能为空</span> -->
<!--         <?php else: ?>&nbsp;<?php endif; ?> -->
        </td>
      </tr>
      <tr>
        <td class="title">产品规格:</td>
        <td class="content"><input name="spec" type="text" id="spec" value="<?php echo $_POST['spec']; ?>
" size="30" /></td>
        <td class="content">例如：50ml,200g,5kg,0.5g×20 等</td>
      </tr>
      <tr>
        <td class="title">产品单位:</td>
        <td class="content"><input name="unit" type="text" id="unit" value="<?php echo $_POST['unit']; ?>
" size="30" /></td>
        <td class="content">例如：瓶,袋,箱  等</td>
      </tr>
      <tr>
        <td class="title">入库数量: *</td>
        <td class="content"><input name="number" type="text" id="number" value="<?php echo $_POST['number']; ?>
" onchange="$('#pricetotal').val($('#pricebuy').val()*$('#number').val())" size="30" />
        </td>
        <td class="content">
        <?php if ($this->_tpl_vars['errors']['empty_number']): ?><span class="warning">入库数量不能为空</span>
        <?php else: ?>&nbsp;<?php endif; ?>
        </td>
      </tr>
      <?php if (0): ?><tr>
        <td class="title">生产日期:</td>
        <td class="content"><?php echo smarty_function_html_select_date(array('field_order' => 'YMD','start_year' => $this->_tpl_vars['start_year'],'end_year' => $this->_tpl_vars['end_year'],'month_format' => "%m",'prefix' => 'start_','time' => ((is_array($_tmp=@$this->_tpl_vars['timestart'])) ? $this->_run_mod_handler('default', true, $_tmp, @$this->_tpl_vars['purchases']['timestart']) : smarty_modifier_default($_tmp, @$this->_tpl_vars['purchases']['timestart']))), $this);?>
</td>
        <td class="content">&nbsp;</td>
      </tr><?php endif; ?>
      <tr style="display:none;">
        <td class="title">保质期:*</td>
        <td class="content"><input name="usedby" type="text" id="usedby" value="365" size="10"/> <select name="usedbyunit" id="usedbyunit"><option value="day">天</option><option value="month">月</option><option value="year">年</option></select></td>
          <td class="content">
        <?php if ($this->_tpl_vars['errors']['empty_usedby']): ?><span class="warning">保质期不能为空</span>
        <?php else: ?>&nbsp;<?php endif; ?>
        </td>
      </tr>
      <tr>
        <td class="title">过期时间:</td>
        <td class="content"><?php echo smarty_function_html_select_date(array('field_order' => 'YMD','start_year' => $this->_tpl_vars['start_year'],'end_year' => $this->_tpl_vars['end_year'],'month_format' => "%m",'prefix' => 'end_','time' => $this->_tpl_vars['timeend']), $this);?>
</td>
        <td class="content">
		<?php if ($this->_tpl_vars['errors']['endtime_error']): ?><span class="warning">过期时间不能为今天</span>
        <?php else: ?>&nbsp;<?php endif; ?>
		</td>
      </tr>
       <tr>
        <td class="title">到货时间:</td>
        <td class="content"><?php echo smarty_function_html_select_date(array('field_order' => 'YMD','start_year' => $this->_tpl_vars['start_year'],'end_year' => $this->_tpl_vars['end_year'],'month_format' => "%m",'time' => ((is_array($_tmp=@$this->_tpl_vars['timeexpress'])) ? $this->_run_mod_handler('default', true, $_tmp, @$this->_tpl_vars['purchases']['timeexpress']) : smarty_modifier_default($_tmp, @$this->_tpl_vars['purchases']['timeexpress']))), $this);?>
</td>
        <td class="content">&nbsp;</td>
      </tr>
       <tr>
        <td class="title">入库类型:</td>
        <td class="content">
        <?php echo smarty_function_html_options(array('name' => 'type','options' => $this->_tpl_vars['type']), $this);?>

        
        
        </td>
        <td class="content">&nbsp;</td>
      </tr>
      <tr>
        <td class="title">备注说明:</td>
        <td colspan="2" class="content"><textarea name="memo" cols="80" rows="5"  id="memo"><?php echo $_POST['memo']; ?>
</textarea></td>
      </tr>
      <tr class="noline">
      	<td class="title">商品条码数字:</td>
      	<td class="content"><input name="barcode" type="text" id="barcode" value="" maxlength="13" size="30" /></td>
      	<td class="content"><span class="warning">请确认已经完成以上的所有字段，最好最后扫码，因为有可能扫完会自动提交</span></td>
      </tr>
    </table>
    
    <div class="fr mt10">
    <input type="submit" value="添加" class="btn" />
    <a href="#this" class="btn" onclick="location.href='<?php echo $this->_tpl_vars['site_admin']; ?>
m=inventory&s=income.php'">取消</a> 
        <input name="action" type="hidden" id="action" value="create" />
    </div>
  </form>
</div>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/bottom.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
</body>
</html>